<%
  # Required Arguments:
  # => pageargs['batch']
  #       The related race batch
  # => pageargs['schemes']
  #       All betting scheme strategies
  # => pageargs['place_prob_sets']
  #       Related place betting scheme probability calculation with suitable expected return
  # => pageargs['quinella_prob_sets']
  #       Related quinella betting scheme probability calculation with suitable expected return
  # => pageargs['qplace_prob_sets']
  #       Related quinella place betting scheme probability calculation with suitable expected return

%>

<div class="bet-suggestion">

% if pageargs['batch']:
  % for scheme in pageargs['schemes']:
    <div class="scheme-set clear-wrapper">
      <h2>${scheme.name}</h2>
      <div class="block place">
      <h3>Place Scheme</h3>
      <table>
        <tr><th>No</th><th>Prob</th><th>ExRet</th><th>Bet</th><th>Res</th></tr>
        % for entry in pageargs['place_prob_sets'][scheme.name]:
        <% 
          bet = entry.get_bet(scheme) 
          if bet > 0:
            bet_class="bet"
          else:
            bet_class=""
        %>
        <tr class="${bet_class}"><td>${entry.horse_no}</td><td>${"%.2f" % (entry.probability)}</td><td>${"%.2f" % (entry.expected_return)}</td><td>${bet}</td><td>${entry.get_result(scheme)}</td></tr>
        % endfor
      </table>
      </div>
    
      <div class="block quinella">
      <h3>Quinella Scheme</h3>
      <table>
        <tr><th>1st</th><th>2nd</th><th>Prob</th><th>ExRet</th><th>Bet</th><th>Res</th></tr>
        % for entry in pageargs['quinella_prob_sets'][scheme.name]:
        <% 
          bet = entry.get_bet(scheme) 
          if bet > 0:
            bet_class="bet"
          else:
            bet_class=""
        %>
        <tr class="${bet_class}"><td>${entry.first_horse_no}</td><td>${entry.second_horse_no}</td><td>${"%.2f" % (entry.probability)}</td><td>${"%.2f" % (entry.expected_return)}</td><td>${bet}</td><td>${entry.get_result(scheme)}</td></tr>
        % endfor
      </table>
      </div>
    
      <div class="block quinella">
      <h3>Quinella Place Scheme</h3>
      <table>
        <tr><th>1st</th><th>2nd</th><th>Prob</th><th>ExRet</th><th>Bet</th><th>Res</th></tr>
        % for entry in pageargs['qplace_prob_sets'][scheme.name]:
        <% 
          bet = entry.get_bet(scheme) 
          if bet > 0:
            bet_class="bet"
          else:
            bet_class=""
        %>
        <tr class="${bet_class}"><td>${entry.first_horse_no}</td><td>${entry.second_horse_no}</td><td>${"%.2f" % (entry.probability)}</td><td>${"%.2f" % (entry.expected_return)}</td><td>${bet}</td><td>${entry.get_result(scheme)}</td></tr>
        % endfor
      </table>
      </div>
    </div>
  % endfor
% endif

</div>